home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 34 / Amiga Format CD34 (1998-11-20)(Future Publishing)(GB)[!][Christmas issue].iso / -seriously_amiga- / programming / c / viewperf5.1 / viewperf / env.h < prev    next >
C/C++ Source or Header  |  1998-10-01  |  5KB  |  110 lines

  1. #include <stdio.h>
  2.  
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifndef TRUE
  7. #define TRUE 1
  8. #endif
  9. #ifndef FALSE
  10. #define FALSE 0
  11. #endif
  12.  
  13.  
  14. /* Type declarations */
  15.  
  16. typedef unsigned int Visual_ID;
  17.   
  18. typedef struct {
  19.   int doubleBuffer;     /* boolean, TRUE if double buffered */
  20.   int stereo;           /* boolean, TRUE if stereo */
  21.   int rgba;             /* boolean, TRUE if rgba, FALSE if color index */
  22.  
  23.   int indexSize;        /* if NOT rgba, depth of color index color buffer*/
  24.  
  25.   int redSize;          /* if rgba, depth of red   color buffer channel */
  26.   int greenSize;        /* if rgba, depth of green color buffer channel */
  27.   int blueSize;         /* if rgba, depth of blue  color buffer channel */
  28.   int alphaSize;        /* if rgba, depth of alpha color buffer channel */
  29.  
  30.   int accumRedSize;     /* if rgba, depth of red   accum buffer channel */
  31.   int accumGreenSize;   /* if rgba, depth of green accum buffer channel */
  32.   int accumBlueSize;    /* if rgba, depth of blue  accum buffer channel */
  33.   int accumAlphaSize;   /* if rgba, depth of alpha accum buffer channel */
  34.  
  35.   int depthSize;        /* depth of depth buffer (z buffer) */
  36.   int stencilSize;      /* depth of stencil buffer */
  37.   int auxBuffers;       /* number of auxiliary buffers */
  38.  
  39.   int level;            /* frame buffer level, <  0 implies underlay planes
  40.                          *                     == 0 implies main planes
  41.                          *                     >  0 implies overlay planes
  42.                          */
  43. #if defined(XWINDOWS)
  44.   Visual_ID visualId;    /* visual ID, X handle to visual descriptor */
  45.   int visualClass;      /* visual class, TrueColor, PseudoColor, etc. */
  46. #elif defined(WIN32)
  47.   int ipfd;             /* pixel format ID */
  48. #endif
  49. } BufferConfig;
  50.  
  51. typedef struct {
  52.   int month;            /* month test was run, in the range [1-12] */
  53.   int day;              /* day   test was run, in the range [1-31] */
  54.   int year;             /* year  test was run, as a four digit number */
  55.   char *host;           /* what machine this test was run on */
  56.   char *hostOperatingSystem; /* what OS this test was run under */
  57.   char *hostOperatingSystemVersion; /* what OS version test was run under */
  58.   char *hostVendor;     /* who manufactured machine test was run on */
  59.   char *hostModel;      /* model designation of the host */
  60.   char *hostCPU;        /* CPU in the host */
  61.   char *hostCPUCount;   /* number of CPU's in host */
  62.   int hostMemorySize;   /* number of MB of memory installed on test machine */
  63.   char *hostPrimaryCacheSize; /* number of KB in primary cache */
  64.   char *hostSecondaryCacheSize; /* number of KB in secondary cache */
  65.   char *windowSystem;   /* name of target window system */
  66.   char *driverVersion;  /* graphics driver version */
  67.   char *glVendor;       /* OpenGL vendor name */
  68.   char *glVersion;      /* OpenGL version */
  69.   char *glExtensions;   /* OpenGL extension list */
  70.   char *glRenderer;     /* OpenGL renderer name, e.g. graphics device */
  71.   char *glClientVendor; /* OpenGL client vendor */
  72.   char *glClientVersion; /* OpenGL client version */
  73.   char *glClientExtensions; /* OpenGL client extensions */
  74.   char *gluVersion;     /* GLU version */
  75.   char *gluExtensions;  /* GLU extension list */
  76.   int directRender;     /* boolean, TRUE if direct rendering connection */
  77.   BufferConfig bufConfig; /* OpenGL buffer configuration, buffer depths etc. */
  78.   int windowWidth;      /* width of the window in pixels */
  79.   int windowHeight;     /* height of the window in pixels */
  80.   int screenWidth;      /* width of the screen in pixels */
  81.   int screenHeight;     /* height of the screen in pixels */
  82.  
  83. #if defined(XWINDOWS)
  84.   char *display;        /* name of the display, e.g. what node server is on */
  85.   char *glServerVendor; /* OpenGL server vendor */
  86.   char *glServerVersion; /* OpenGL server version */
  87.   char *glServerExtensions; /* OpenGL server extensions */
  88.   char *glxVersion;     /* GLX version, effective connection version */
  89.   char *glxExtensions;     /* GLX extensions, effective extension set */
  90.   int screenNumber;     /* which screen of the X server */
  91.   int sharedMemConnection;  /* boolean, TRUE if shared memory connection */
  92. #endif
  93. } EnvironmentInfo;
  94.  
  95. /* Function Prototypes */
  96.  
  97. char *StringSearch(char *subject, char *pattern);
  98. int GetDateTime(int *month, int *day, int *year, int *hour, int *minute);
  99. int GetEnvironment(EnvironmentInfo *info);
  100. void FreeEnvironmentData(EnvironmentInfo *info);
  101. void NullEnvironmentData(EnvironmentInfo *info);
  102. void PrintEnvironment(FILE *stream, EnvironmentInfo *info, char *title,
  103.                       char *leader, int nameWidth, char *suffix);
  104.  
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108.  
  109.  
  110.